import java.util.Scanner;

class ArrayUtils{
	static class PairResult{
		private double min;
		private double max;
		@Override
		public String toString() {
			return "PairResult [min=" + min + ", max=" + max + "]";
		}
	}
	public static PairResult findMinMax(double[] values){
		 double max=values[0];//设最小最大为values[0];打擂台
		 double min=values[0];//
		 for (int i = 0; i < values.length; i++) {
			if(values[i]>max){
				max=values[i];
			}
			else if(values[i]<min){
				min=values[i];
			}
		}
		 PairResult pairresult=new PairResult();
		 pairresult.max=max;pairresult.min=min;
		 return pairresult;
	}
}
public class ArrayUtil {
     public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		int n=in.nextInt();
		double[] arr=new double[n];
		for (int i = 0; i < arr.length; i++) {
			arr[i]=in.nextDouble();
		}
		System.out.println(ArrayUtils.findMinMax(arr));
		System.out.println(ArrayUtils.PairResult.class);
		in.close();
     }
	
}

